package com.company.www;

import java.util.concurrent.CountDownLatch;

public class Boss implements Runnable {

    private CountDownLatch countDownLatch;

    public Boss(CountDownLatch countDownLatch) {
        this.countDownLatch = countDownLatch;
    }

    @Override
    public void run() {
        System.out.println("老板等待所有人干完活");
        try {
            countDownLatch.await();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("count = " + countDownLatch.getCount());
        System.out.println("所有人都干完活了，老板开始检查工作");
    }
}
